package org.fhm.zdte.protocol.zrudp.pojo;


import org.fhm.substrate.annotation.Component;
import org.fhm.zdte.common.constant.protocol.ContentType;
import org.fhm.zdte.common.constant.protocol.PacketType;
import org.fhm.zdte.common.constant.protocol.ResponseMessageType;
import org.fhm.zdte.common.pojo.Address;
import org.fhm.zdte.common.protocol.AbstractMessageStandard;
import org.fhm.zdte.common.standard.ISubCmd;

import java.util.Arrays;

/**
 * A ZRUDP packet.
 *
 * @author 谭波
 * @since 2023/10/31
 */
@Component("zrudp")
@SuppressWarnings("unused")
public class ZRUDPMessageStandard extends AbstractMessageStandard {
    private PacketType packetType;
    private ISubCmd packetSubType;
    private ResponseMessageType responseMessageType;
    private String messageNumber;
    private Integer serialNumber;
    private Integer messageLength;
    private String from;
    private Address fromAddress;
    private String to;
    private Address toAddress;
    private String secretKey;
    private ContentType contentType;

    private byte[] content;


    @Override
    public PacketType getPacketType() {
        return packetType;
    }

    public void setPacketType(PacketType packetType) {
        this.packetType = packetType;
    }

    @Override
    public ISubCmd getPacketSubType() {
        return packetSubType;
    }

    public void setPacketSubType(ISubCmd packetSubType) {
        this.packetSubType = packetSubType;
    }

    @Override
    public ResponseMessageType getResponseMessageType() {
        return responseMessageType;
    }

    public void setResponseMessageType(ResponseMessageType responseMessageType) {
        this.responseMessageType = responseMessageType;
    }

    @Override
    public String getMessageNumber() {
        return messageNumber;
    }

    public void setMessageNumber(String messageNumber) {
        this.messageNumber = messageNumber;
    }

    @Override
    public Integer getSerialNumber() {
        return serialNumber;
    }

    public void setSerialNumber(Integer serialNumber) {
        this.serialNumber = serialNumber;
    }

    @Override
    public Integer getMessageLength() {
        return messageLength;
    }

    public void setMessageLength(Integer messageLength) {
        this.messageLength = messageLength;
    }

    @Override
    public String getFrom() {
        return from;
    }

    public void setFrom(String from) {
        this.from = from;
    }

    @Override
    public Address getFromAddress() {
        return fromAddress;
    }

    public void setFromAddress(Address fromAddress) {
        this.fromAddress = fromAddress;
    }

    @Override
    public String getTo() {
        return to;
    }

    public void setTo(String to) {
        this.to = to;
    }

    @Override
    public Address getToAddress() {
        return toAddress;
    }

    public void setToAddress(Address toAddress) {
        this.toAddress = toAddress;
    }

    @Override
    public String getSecretKey() {
        return secretKey;
    }

    public void setSecretKey(String secretKey) {
        this.secretKey = secretKey;
    }

    @Override
    public ContentType getContentType() {
        return contentType;
    }

    public AbstractMessageStandard setContentType(ContentType contentType) {
        this.contentType = contentType;
        return this;
    }

    @Override
    public byte[] getContent() {
        return content;
    }

    public void setContent(byte[] content) {
        this.content = content;
    }

    @Override
    public String toString() {
        return "ZRUDPMessageStandard{" +
                "packetType=" + packetType +
                ", packetSubType=" + packetSubType +
                ", responseMessageType=" + responseMessageType +
                ", messageNumber='" + messageNumber + '\'' +
                ", serialNumber=" + serialNumber +
                ", messageLength=" + messageLength +
                ", from='" + from + '\'' +
                ", fromAddress=" + fromAddress +
                ", to='" + to + '\'' +
                ", toAddress=" + toAddress +
                ", secretKey='" + secretKey + '\'' +
                ", content=" + Arrays.toString(content) +
                '}';
    }
}
